ANIMATING IN ONE DIRECTION THEN IN ANOTHER ONCE YOU GET TO TARGET (could be used to animate stuff flying one way or another?)
function Create(self)
   self.FrameTimer = Timer();
   self.FrameInterval = 250;
   self.FrameTimer:Reset();
   self.Frame = 0;
   self.FrameDirection = 0;
end
function Update(self)
   if self.Frame == 0 then
      self.FrameDirection = 0;
   elseif self.Frame == 7 then
      self.FrameDirection = 1;
   end
   if self.FrameTimer:IsPastSimMS(self.FrameInterval) then
      if self.FrameDirection == 0 and self.Frame < 8 then
         self.Frame = self.Frame + 1;
      elseif self.FrameDirection == 1 and self.Frame > 0  then
         self.Frame = self.Frame - 1;
      end
      self.FrameTimer:Reset()
   end
end
function Destroy(self)
end

ADDING GIBS WHEN STUFF DIES

function Destroy(self)
  local particle = CreateMOSRotating("blah")
  particle.Pos = self.Pos
  particle.Vel = self.Vel
  MovableMan:AddParticle(particle)
end

ATTACHABLE STUFF (What this does is that it finds AEmitters that are attached it when it is created, and then changes their frame according to the scripted object's velocity. Also, be sure to change the SpriteAnimMode so the emitters can't animate on their own and allow the script to do it.)
function Create(self)
   self.makeframe = 0;
   self.emitterlist = {};

   for i = 1,MovableMan:GetMOIDCount()-1 do
      attachable = MovableMan:GetMOFromID(i);
    if attachable.PresetName == "AEmitter Name" and attachable.ClassName == "AEmitter" and attachable.RootID == self.RootID then
   self.emitterlist[#self.emitterlist+1] = attachable;
    end
   end

end

function Update(self)

   if self.Vel.Magnitude < 10 then
   self.makeframe = 0;
   elseif self.Vel.Magnitude => 10 and self.Vel.Magnitude < 20 then
   self.makeframe = 1;
   end

   for i = 1, #self.emitterlist do
    if self.emitterlist[i].ID ~= 255 then
   self.emitterlist[i].Frame = self.makeframe;
    end
   end

end
